﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Threading;

namespace CBE.UI.Shell
{
    public class Login
    {

        const string loginTypeString = "SEG.UI.Control.IdentificarUsuarioController, SEG.UI.Control";
        static Type controllerType;

        public static void ShowLogin()
        {
            controllerType = Type.GetType(loginTypeString);

            Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Normal, new Action<object>(ControllerInvoke), null);
        }


        private static void ControllerInvoke(object o)
        {
            var controller = controllerType.GetConstructor(Type.EmptyTypes).Invoke(null);

            controllerType.GetMethod("Run").Invoke(controller, null);
        }
    }
}
